home *** CD-ROM | disk | FTP | other *** search
/ Mac Format 1996 April / MacFormat CD Edition MF36 (April 1996).iso / Shareware City / Developers / Tools Plus - GUI⁄Event libs / Tools Plus 2.6.1a Evaluat'n Kit / Tools Plus 2.6.1a / User Manual / 07-Picture Buttons (3 of 3) < prev    next >
INI File  |  1994-09-17  |  16KB  |  283 lines

  1. [Display using Monaco 9]
  2.  
  3.  
  4. DeletePictButton
  5. ````````````````
  6. Delete a picture button.
  7.  
  8.    pascal void DeletePictButton(short Button);
  9.  
  10.    procedure DeletePictButton(Button: INTEGER);
  11.  
  12.   Button specifies the picture button number (from 1 to 255) that is deleted from the current window.  If the current window doesn’t belong to your application, or if no windows are open, or if the picture button does not exist in the current window, DeletePictButton does nothing.
  13.  
  14. ------------------------------------------------------------------------
  15.  
  16. EnablePictButton
  17. ````````````````
  18. Enable or disable a picture button.
  19.  
  20.    pascal void EnablePictButton(short Button, Boolean EnabledFlag);
  21.  
  22.    procedure EnablePictButton(Button: INTEGER; EnabledFlag: BOOLEAN);
  23.  
  24.   Button specifies the picture button number (from 1 to 255) that is affected in the current window.  If the current window doesn’t belong to your application, or if no windows are open, or if the picture button does not exist in the current window, EnablePictButton does nothing.
  25.  
  26.   The EnabledFlag indicates if the picture button is enabled or not.  All three picture button types can be either enabled or disabled.  When a picture button is disabled, it becomes dim and cannot be selected by the user.  All picture buttons automatically become disabled when the window containing them is inactive.  When the window is activated, the picture buttons assume their state as set by the NewPictButton procedure, and subsequent calls to the EnablePictButton procedure.  The two constants that can be used for this flag are enabled and disabled.
  27.  
  28.   CONST                   {Button state                           }
  29.     enabled     =true;    {button is enabled                      }
  30.     disabled    =false;   {button is disabled                     }
  31.  
  32.  
  33. See the NewPictButton procedure for additional information pertaining to the picture button’s enabling, disabling, and selection.
  34.  
  35. ------------------------------------------------------------------------
  36.  
  37. SelectPictButton
  38. ````````````````
  39. Select or deselect a picture button.
  40.  
  41.    pascal void SelectPictButton(short Button, Boolean SelectedFlag);
  42.  
  43.    procedure SelectPictButton(Button: INTEGER; SelectedFlag: BOOLEAN);
  44.  
  45.   Button specifies the picture button number (from 1 to 255) that is affected in the current window.  If the current window doesn’t belong to your application, or if no windows are open, or if the picture button does not exist in the current window, SelectPictButton does nothing.
  46.  
  47.   The SelectedFlag indicates if the picture button is selected or not.  The two constants that can be used for this flag are selected and notSelected.
  48.  
  49.   CONST                   {Button state                           }
  50.     selected    =true;    {button is selected (checked)           }
  51.     notSelected =false;   {button is not selected (not checked)   }
  52.  
  53. See the NewPictButton procedure for additional information pertaining to the picture button’s enabling, disabling, and selection.
  54.  
  55. ------------------------------------------------------------------------
  56.  
  57. GetPictButtonMin
  58. ````````````````
  59. Get a picture button’s minimum value limit.
  60.  
  61.    pascal short GetPictButtonMin (short Button);
  62.  
  63.    function GetPictButtonMin (Button: INTEGER): INTEGER;
  64.  
  65.   Button specifies the picture button number (from 1 to 255) that is queried in the current window.
  66.  
  67.   GetPictButtonMin returns a picture button’s minimum value limit.  If the current window doesn’t belong to your application, or if no windows are open, or if the picture button does not exist in the current window, GetPictButtonMin will return a value of zero (0).
  68.  
  69. ------------------------------------------------------------------------
  70.  
  71. SetPictButtonMin
  72. ````````````````
  73. Set a picture button’s minimum value limit.
  74.  
  75.    pascal void SetPictButtonMin (short Button, short minimum);
  76.  
  77.    procedure SetPictButtonMin (Button, minimum: INTEGER);
  78.  
  79.   Button specifies the picture button number (from 1 to 255) that is affected in the current window.  If the current window doesn’t belong to your application, or if no windows are open, or if the picture button does not exist in the current window, SetPictButtonMin does nothing.  The minimum and maximum limit cannot be changed in multistage buttons.
  80.  
  81.   Minimum specifies the picture button’s new minimum value limit.  The picture button’s current value and maximum limit are automatically adjusted (if necessary) to be consistent with the new minimum limit.
  82.  
  83. ------------------------------------------------------------------------
  84.  
  85. GetPictButtonMax
  86. ````````````````
  87. Get a picture button’s maximum value limit.
  88.  
  89.    pascal short GetPictButtonMax (short Button);
  90.  
  91.    function GetPictButtonMax (Button: INTEGER): INTEGER;
  92.  
  93.   Button specifies the picture button number (from 1 to 255) that is queried in the current window.
  94.  
  95.   GetPictButtonMax returns a picture button’s maximum value limit.  If the current window doesn’t belong to your application, or if no windows are open, or if the picture button does not exist in the current window, GetPictButtonMax will return a value of zero (0).
  96.  
  97. ------------------------------------------------------------------------
  98.  
  99. SetPictButtonMax
  100. ````````````````
  101. Set a picture button’s maximum value limit.
  102.  
  103.    pascal void SetPictButtonMax (short Button, short maximum);
  104.  
  105.    procedure SetPictButtonMax (Button, maximum: INTEGER);
  106.  
  107.   Button specifies the picture button number (from 1 to 255) that is affected in the current window.  If the current window doesn’t belong to your application, or if no windows are open, or if the picture button does not exist in the current window, SetPictButtonMax does nothing.  The minimum and maximum limit cannot be changed in multistage buttons
  108.  
  109.   Maximum specifies the picture button’s new maximum value limit.  The picture button’s current value and minimum limit are automatically adjusted (if necessary) to be consistent with the new maximum limit.
  110.  
  111. ------------------------------------------------------------------------
  112.  
  113. GetPictButtonVal
  114. ````````````````
  115. Get a picture button’s current value.
  116.  
  117.    pascal short GetPictButtonVal (short Button);
  118.  
  119.    function GetPictButtonVal (Button: INTEGER): INTEGER;
  120.  
  121.   Button specifies the picture button number (from 1 to 255) that is queried in the current window.
  122.  
  123.   GetPictButtonVal returns a picture button’s current value.  If the current window doesn’t belong to your application, or if no windows are open, or if the picture button does not exist in the current window, GetPictButtonVal will return a value of zero (0).
  124.  
  125. ------------------------------------------------------------------------
  126.  
  127. SetPictButtonVal
  128. ````````````````
  129. Set a picture button’s current value.
  130.  
  131.    pascal void SetPictButtonVal (short Button, short value);
  132.  
  133.    procedure SetPictButtonVal (Button, Value: INTEGER);
  134.  
  135.   Button specifies the picture button number (from 1 to 255) which is to be affected in the current window.  If the current window doesn’t belong to your application, or if no windows are open, or if the picture button does not exist in the current window, SetPictButtonVal does nothing.
  136.  
  137.   Value specifies the picture button’s new current value.  In multistage buttons, the value is adjusted to fit within the button’s minimum and maximum limit.  In single stage buttons, the minimum and maximum limits are automatically adjusted (if necessary) to be consistent with the new current value.
  138.  
  139. ------------------------------------------------------------------------
  140.  
  141. SetPictButtonValSelect
  142. ``````````````````````
  143. Set a picture button’s current value, and simultaneously select or deselect the button.
  144.  
  145.    pascal void SetPictButtonValSelect (short Button, short value,
  146.                  Boolean SelectedFlag);
  147.  
  148.    procedure SetPictButtonValSelect (Button, Value: INTEGER;
  149.                  SelectedFlag: BOOLEAN);
  150.  
  151.   Sometimes, it is necessary to simultaneously change a button’s value and to select or deselect it, otherwise the transition from one stage to another would look jerky.  An example of this is a multistage button that locks in the selected position, then lets your application determine if conditions allow the button to be deselected in the next stage (indicating acceptance of the button’s action), or deselected in the same stage (indicating rejection of the button’s action).
  152.  
  153.   Button specifies the picture button number (from 1 to 255) which is to be affected in the current window.  If the current window doesn’t belong to your application, or if no windows are open, or if the picture button does not exist in the current window, SetPictButtonValSelect does nothing.
  154.  
  155.   Value specifies the picture button’s new current value.  In multistage buttons, the value is adjusted to fit within the button’s minimum and maximum limit.  In single stage buttons, the minimum and maximum limits are automatically adjusted (if necessary) to be consistent with the new current value.
  156.  
  157.   The SelectedFlag indicates if the picture button is selected or not.  The two constants that can be used for this flag are selected and notSelected.
  158.  
  159.   CONST                   {Button state                           }
  160.     selected    =true;    {button is selected (checked)           }
  161.     notSelected =false;   {button is not selected (not checked)   }
  162.  
  163. ------------------------------------------------------------------------
  164.  
  165. SetPictButtonAccel
  166. ``````````````````
  167. Set a picture button’s value change rate.
  168.  
  169.    pascal void SetPictButtonAccel (short Button, short Rate);
  170.  
  171.    procedure SetPictButtonAccel (Button, Rate: INTEGER);
  172.  
  173.   Button specifies the picture button number (from 1 to 255) which is to be affected in the current window.  If the current window doesn’t belong to your application, or if no windows are open, or if the picture button does not exist in the current window, SetPictButtonAccel does nothing.
  174.  
  175.   Rate specifies the rate at which the picture button’s value changes.  The four constants that can be used for this setting are:
  176.  
  177. picbutLinear      Linear: The button’s value changes when the button is
  178.                   selected.  After a brief pause, the value continues to
  179.                   change at a slow and consistent rate.
  180.  
  181. picbutSlowAccel   Slow Acceleration: The button’s value changes when the
  182.                   button is selected.  After a brief pause, the value
  183.                   continues to change at a rate that slowly accelerates.
  184.  
  185. picbutMedAccel    Medium Acceleration: The button’s value changes when
  186.                   the button is selected.  After a brief pause, the
  187.                   value continues to change at a moderately accelerating
  188.                   rate.
  189.  
  190. picbutFastAccel   Fast Acceleration: The button’s value changes when the
  191.                   button is selected.  After a brief pause, the value
  192.                   continues to change at a rate that rapidly
  193.                   accelerates.
  194.  
  195.   The affected picture button must be created with the “automatic value change” and “repeating events” options both turned on for this routine to have any effect.  Using SetPictButtonAccel overrides the settings established by the SetPictButtonSpeed procedure.
  196.  
  197.   CONST                   {Value change rates:             }
  198.     picbutLinear    = 0;  {Linear (does not accelerate)    }
  199.     picbutSlowAccel = 1;  {Slow acceleration               }
  200.     picbutMedAccel  = 2;  {Medium acceleration             }
  201.     picbutFastAccel = 3;  {Fast acceleration               }
  202.  
  203.   See the NewPictButton procedure for additional information pertaining to the picture button’s automatic value change rate.  Also see the SetPictButtonSpeed procedure for another method of setting the button’s speed.
  204.  
  205. ------------------------------------------------------------------------
  206.  
  207. SetPictButtonSpeed
  208. ``````````````````
  209. Set a picture button’s value change speed.
  210.  
  211.    pascal void SetPictButtonSpeed (short Button, short Rate);
  212.  
  213.    procedure SetPictButtonSpeed (Button, Rate: INTEGER);
  214.  
  215.   Button specifies the picture button number (from 1 to 255) which is to be affected in the current window.  If the current window doesn’t belong to your application, or if no windows are open, or if the picture button does not exist in the current window, SetPictButtonSpeed does nothing.
  216.  
  217.   Rate specifies the constant speed at which the picture button’s value changes.  The rate is expressed as an amount that is incremented per second (i.e., “30” means change the button’s value by 30 for each second it is held down).
  218.  
  219.   The picture button’s value will change at the specified speed as soon as the user presses down on the button (there is no pause before the event starts repeating.)  The affected picture button must be created with the “automatic value change” and “repeating events” options both turned on for this routine to have any effect.  Using SetPictButtonSpeed overrides the settings established by the SetPictButtonAccel procedure.
  220.  
  221.   See the SetPictButtonAccel procedure for another method of setting the button’s value change rate.
  222.  
  223. ------------------------------------------------------------------------
  224.  
  225. PictButtonIsEnabled
  226. ```````````````````
  227. Determine if a picture button is enabled or disabled.
  228.  
  229.    pascal Boolean PictButtonIsEnabled (short Button);
  230.  
  231.    function PictButtonIsEnabled (Button: INTEGER): BOOLEAN;
  232.  
  233.   Button specifies the picture button number (from 1 to 255) which is queried in the current window.
  234.  
  235.   The function’s value returns true if the picture button is enabled, and false if the picture button is disabled.  If the current window doesn’t belong to your application, or if no windows are open, or if the picture button does not exist in the current window, PictButtonIsEnabled returns false.
  236.  
  237.   CONST                   {Button state                           }
  238.     enabled     =true;    {button is enabled                      }
  239.     disabled    =false;   {button is disabled                     }
  240.  
  241. See the NewPictButton procedure for additional information pertaining to the picture button’s enabling, disabling, and selection.
  242.  
  243. Note: PictButtonIsEnabled returns the picture button’s state as though
  244.       the picture button’s window is active.  This is the case even when
  245.       the window is deactivated and all the picture buttons appear
  246.       disabled.
  247.  
  248. ------------------------------------------------------------------------
  249.  
  250. PictButtonIsSelected
  251. ````````````````````
  252. Determine if a picture button is selected.
  253.  
  254.    pascal Boolean PictButtonIsSelected (short Button);
  255.  
  256.    function PictButtonIsSelected (Button: INTEGER): BOOLEAN;
  257.  
  258.   Button specifies the picture button number (from 1 to 255) that is queried in the current window.
  259.  
  260.   The function’s value returns true if the picture button is selected, and false if the picture button is not selected.  If the current window doesn’t belong to your application, or if no windows are open, or if the picture button does not exist in the current window, PictButtonIsSelected returns false.
  261.  
  262.   CONST                   {Button state                           }
  263.     selected    =true;    {button is selected (checked)           }
  264.     notSelected =false;   {button is not selected (not checked)   }
  265.  
  266.   See the NewPictButton procedure for additional information pertaining to the picture button’s enabling, disabling, and selection.
  267.  
  268. ------------------------------------------------------------------------
  269.  
  270. FlashPictButton
  271. ```````````````
  272. Flash a picture button as though it was clicked by the user.
  273.  
  274.    pascal void FlashPictButton(short Button);
  275.  
  276.    procedure FlashPictButton(Button: INTEGER);
  277.  
  278.   Button specifies the picture button number (from 1 to 255) that is affected in the active window.  If the active window doesn’t belong to your application, or if no windows are open, FlashPictButton does nothing.
  279.  
  280.   FlashPictButton can be used in some specific instances.  Advanced programmers may decide to display a modal window when the Macintosh is busy with a lengthy process.  If a picture button (such as “Cancel”) on this window is equivalent to typing Command-., the picture button should be flashed when a Command-. is reported by PollSystem.  This makes the user feel that the key triggered the picture button.  Another example is double-clicking in a list box; this action can be interpreted as “select line and OK” in which case the OK picture button should be flashed.
  281.  
  282. ------------------------------------------------------------------------
  283.